package com.woniuxy.consumer.controller;

import com.woniuxy.commons.entity.PageBean;
import com.woniuxy.commons.entity.UserDetails;
import com.woniuxy.commons.utils.ResponseResult;
import com.woniuxy.consumer.service.DetailsService;
import com.woniuxy.consumer.service.UserdetailsService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author author
 * @create 2021-11-15 20:02
 */
@RestController
@RequestMapping("/consumer")
public class UserdetailsController {

    @Resource
    private UserdetailsService userdetailsService;

    @Resource
    private DetailsService detailsService;

    @GetMapping("/selectAll")
    public ResponseResult<PageBean<UserDetails>> fenyeUser(
            UserDetails userDetails,int pageSize,int pageIndex
    ){
        return userdetailsService.selectUserDetailsByPageService(userDetails,pageIndex,pageSize);
    }

    @GetMapping("/selectByUid")
    public UserDetails getByUid(String uid){
        System.out.println(uid);
        return detailsService.selectUserByUidService(uid);
    }

}
